#include "sys.h"
#include "def.h"
#include "dev.h"
//显示服务 用于更新屏幕显示
u8 ls_blk=0;
void link_state_update(void)
{
	if(gSys.conn.tcp_link)
	{
		if(ls_blk)
		{
			OLED_ShowString(2,0,(u8*)"***",12);
			ls_blk=0;
		}
		else
		{
			OLED_ShowString(2,0,(u8*)"   ",12);
			ls_blk=1;
		}
	}
	else
	{
		if(ls_blk)
		{
			OLED_ShowString(2,0,(u8*)"...",12);
			ls_blk=0;
		}
		else
		{
			OLED_ShowString(2,0,(u8*)"   ",12);
			ls_blk=1;
		}	
	}
}

void service_screen(void)
{
	u8 buf[20]={0};
	link_state_update();
	//显示IP
	sprintf((char*)buf,"%d.%d.%d.%d",devIP[0],devIP[1],devIP[2],devIP[3]);
	OLED_ShowString(2,28,buf,12);
	//显示时间
	sprintf((char*)buf,"%04d/%02d/%02d %02d:%02d:%02d",gSys.date.year,gSys.date.month,gSys.date.day,gSys.date.hour,gSys.date.min,gSys.date.sec);
	OLED_ShowString(2,40,buf,12);
	//显示MAC
	sprintf((char*)buf,"%02x-%02x-%02x-%02x-%02x-%02x",devMAC[0],devMAC[1],devMAC[2],devMAC[3],devMAC[4],devMAC[5]);
	OLED_ShowString(2,52,buf,12);
	//OLED_ShowString(64,40,buf,12);
	OLED_Refresh_Gram();
}